#!/bin/bash 
echo "开始本地编译"

pnpm run build

echo "编译完成"


now=$(date "+%Y-%m-%d-%H-%M-%S")
imageName=registry.cn-shenzhen.aliyuncs.com/ziyangk/gf-web:$now

echo "镜像名称$imageName"
echo "开始打包镜像。。。"

docker build -f ./Dockerfile -t $imageName .  

echo "打包完成～"

echo "推送到远端仓库。。。"

docker push $imageName

echo "推送完成"

echo "删除本地docker镜像"

docker rmi $imageName

echo "操作完成"
